<include file="head" />

<fieldset class="layui-elem-field layui-field-title" style="width:500px;margin:100px auto 20px;">
    <legend>昆山汉字节小程序管理后台</legend>
</fieldset>
<form class="layui-form" method="post" style="width:500px;margin: 10px auto;">
    <div class="layui-form-item">
        <label class="layui-form-label" style="text-align: center">账号</label>
        <div class="layui-input-block">
            <input type="text" name="account" lay-verify="required" autocomplete="off" placeholder="请输入管账号" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="text-align: center">密码</label>
        <div class="layui-input-block">
            <input type="password" name="pwd" lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="width:100%;text-align: center;">
            <button class="layui-btn" lay-submit="" lay-filter="formLogin" style="width:200px;">登录</button>
        </label>
    </div>
</form>
<script>
    layui.use('form',function(){
        var form = layui.form;
        form.on('submit(formLogin)', function(data){
            $.ajax({
                url:'{#:url("admin/Login/login")#}',
                data:data.field,
                dataType:'json',
                type:'post',
                success:function(res){
                    if(res.status == 0){
                        window.location.href='{#:url("admin/Index/index")#}';
                    }else{
                        layer.msg(res.info,{icon:2});
                    }
                }
            });
            return false;
        });

        $('#captcha').click(function(){
            $(this).attr('src','{#:captcha_src()#}?v='+Math.random());
        });

    });


</script>
<include file="foot" />